@layout("/layouts/default.html",{"title":"字典管理"}){
<div class="row" ng-controller="dictCtrl" ng-init="init()">
    <!--查询表单-->
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h2><i class="fa fa-indent red"></i><strong>字典查询</strong></h2>
                <div class="panel-actions">
                    <a class="btn-link btn-minimize"><i class="fa fa-chevron-up"></i></a>
                </div>
            </div>
            <form class="form-inline group-border" name="queryForm" novalidate="novalidate" ng-submit="doQuery()">
                <div class="panel-body">
                    <div class="form-group">
                        <label class=" control-label">类型</label>
                        <select  ng-model="query.type" class="form-control " >
                            <option value="">请选择</option>
                            <option ng-repeat="type in typeList">{{type}}</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label class=" control-label">描述</label>
                        <input type="text"  ng-model="query.description" class="form-control ">
                    </div>
                </div>
                <div class="panel-footer">
                    <button type="submit" class="btn btn-sm btn-success"><i class="fa fa-dot-circle-o"></i> 查询</button>
                </div>
            </form>
        </div>
    </div>

    <!--数据列表-->
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h2><i class="fa fa-table red"></i><span class="break"></span><strong>字典列表</strong></h2>
                <div class="panel-actions">
                    <a class="btn-link" ng-click="add()"><i class="fa fa-plus"></i></a>
                    <a class="btn-link btn-minimize"><i class="fa fa-chevron-up"></i></a>
                </div>
            </div>
            <div class="panel-body">

                <table class="table table-striped table-bordered bootstrap-datatable datatable">
                    <thead>
                    <tr>
                        <th>键值</th>
                        <th>标签</th>
                        <th>类型</th>
                        <th>描述</th>
                        <th>排序</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @for(dict in page.list){
                    <tr ng-repeat="dict in dicts">
                        <td>${dict.value}</td>
                        <td>${dict.label}</td>
                        <td>${dict.type}</td>
                        <td>${dict.description}</td>
                        <td>${dict.sort}</td>
                        <td>
                            <a class="btn btn-success" ng-click="detail(dict.id)" title="详情">
                                <i class="fa fa-search-plus "></i>
                            </a>
                            <a class="btn btn-info" ng-click="edit(dict.id)"  title="编辑">
                                <i class="fa fa-edit "></i>
                            </a>
                            <a class="btn btn-danger"  ng-click="deleteItem(dict.id)" title="删除">
                                <i class="fa fa-trash-o "></i>
                            </a>
                            <a ng-click="addValue(dict.id)" class="btn btn-primary">添加键值</a>
                        </td>
                    </tr>
                    @}
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <!--详情、编辑、删除弹出框-->
</div>
@}